package com.zhrj.exam.controller;


import com.zhrj.apis.commons.ResultData;
import com.zhrj.exam.entity.ZhrjScadaEvent;
import com.zhrj.exam.service.IZhrjScadaEventService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author zhrj
 * @since 2023-03-14
 */
@RestController
@RequestMapping("/zhrj-scada-event")
public class ZhrjScadaEventController {

    @Autowired
    private IZhrjScadaEventService zhrjScadaEventService;

    @GetMapping("statistic")
    public List<Map<String,Object>> statisticResult(){
        System.out.println("test");
        return null;
    }

    @GetMapping("/getRTUStatusDataByCondition")
    public ResultData<ZhrjScadaEvent> getRTUStatusDataByCondition(
            @RequestParam("devId") Long devId,
            @RequestParam("startTime") String startTime,
            @RequestParam("endTime") String endTime){
        return zhrjScadaEventService.getRTUStatusDataByCondition(devId, startTime, endTime);
    }

}
